package com.greatchn.authorization_server.web.po;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * @OauthRoleGroupInfo:
 * @author: ZBoHang
 * @time: 2023/2/28 9:07
 */
@Entity
@Table(name = "oauth_role_group_info", schema = "sso", catalog = "")
@IdClass(OauthRoleGroupInfoPK.class)
public class OauthRoleGroupInfo implements Serializable {
    private static final long serialVersionUID = -2214980254532790039L;
    private Integer roleGroupId;
    private String roleGroupName;
    private Integer belongToUserGroupId;
    private Integer perentId;
    private String desc;
    private String state;
    private Timestamp createTime;

    @Id
    @Column(name = "role_group_id", nullable = false)
    public Integer getRoleGroupId() {
        return roleGroupId;
    }

    public void setRoleGroupId(Integer roleGroupId) {
        this.roleGroupId = roleGroupId;
    }

    @Basic
    @Column(name = "role_group_name", nullable = true, length = 255)
    public String getRoleGroupName() {
        return roleGroupName;
    }

    public void setRoleGroupName(String roleGroupName) {
        this.roleGroupName = roleGroupName;
    }

    @Id
    @Column(name = "belong_to_user_group_id", nullable = false)
    public Integer getBelongToUserGroupId() {
        return belongToUserGroupId;
    }

    public void setBelongToUserGroupId(Integer belongToUserGroupId) {
        this.belongToUserGroupId = belongToUserGroupId;
    }

    @Basic
    @Column(name = "perent_id", nullable = true)
    public Integer getPerentId() {
        return perentId;
    }

    public void setPerentId(Integer perentId) {
        this.perentId = perentId;
    }

    @Basic
    @Column(name = "desc", nullable = true, length = 255)
    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Basic
    @Column(name = "state", nullable = true, length = 1)
    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Basic
    @Column(name = "create_time", nullable = true)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OauthRoleGroupInfo that = (OauthRoleGroupInfo) o;
        return Objects.equals(roleGroupId, that.roleGroupId) && Objects.equals(roleGroupName, that.roleGroupName) && Objects.equals(belongToUserGroupId, that.belongToUserGroupId) && Objects.equals(perentId, that.perentId) && Objects.equals(desc, that.desc) && Objects.equals(state, that.state) && Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(roleGroupId, roleGroupName, belongToUserGroupId, perentId, desc, state, createTime);
    }
}
